#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright [Gtlions Lai].
# Create Date:
# Update Date:
"""summarization ahout this script.

detail ahout this script

   Class(): summarization about Class
   ...
   function(): summarization about function
   ...
"""
__authors__ = '"Gtlions Lai" <gtlions.l@qq.com>'

import sys
from PyQt4 import QtGui, QtCore


class Main(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self)
        self.setWindowTitle('Radio Button')
        self.setGeometry(300, 300, 300, 300)
        grid = QtGui.QGridLayout()
        self.setLayout(grid)

        self.sp1 = QtGui.QSpinBox()
        grid.addWidget(self.sp1)
        self.sp2 = QtGui.QSpinBox()
        grid.addWidget(self.sp2)

        self.ret1 = QtGui.QLineEdit('ret')
        grid.addWidget(self.ret1)

        self.connect(self.sp1, QtCore.SIGNAL('editingFinished()'), self.add)
        self.connect(self.sp2, QtCore.SIGNAL('editingFinished()'), self.add)

    def add(self):
        self.ret1.setText(str(self.sp1.value() + self.sp2.value()))

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    main = Main()
    main.show()
    sys.exit(app.exec_())